#include "DialogReviewList.h"

//(*InternalHeaders(DialogReviewList)
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(DialogReviewList)
const long DialogReviewList::ID_LISTCTRL1 = wxNewId();
const long DialogReviewList::ID_BUTTON1 = wxNewId();
const long DialogReviewList::ID_BUTTON2 = wxNewId();
const long DialogReviewList::ID_BUTTON3 = wxNewId();
//*)

BEGIN_EVENT_TABLE(DialogReviewList,wxDialog)
	//(*EventTable(DialogReviewList)
	//*)
END_EVENT_TABLE()

DialogReviewList::DialogReviewList(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
	//(*Initialize(DialogReviewList)
	Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
	SetClientSize(wxSize(565,525));
	Move(wxDefaultPosition);
	ListCtrl1 = new wxListCtrl(this, ID_LISTCTRL1, wxPoint(24,24), wxSize(520,312), 0, wxDefaultValidator, _T("ID_LISTCTRL1"));
	Button1 = new wxButton(this, ID_BUTTON1, _("查看/编辑"), wxPoint(40,432), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
	Button2 = new wxButton(this, ID_BUTTON2, _("增加"), wxPoint(224,432), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
	Button3 = new wxButton(this, ID_BUTTON3, _("关闭"), wxPoint(400,432), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
	
	Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DialogReviewList::OnEditReview);
	Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DialogReviewList::OnAddReview);
	Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DialogReviewList::OnClose);
	//*)

	DlgReview = new DialogEditReview(this);
	DlgReview->Show(false);
}

DialogReviewList::~DialogReviewList()
{
	//(*Destroy(DialogReviewList)
	//*)

	if(DlgReview)
        delete DlgReview;
}


void DialogReviewList::OnClose(wxCommandEvent& event)
{
    this->Show(false);
}

void DialogReviewList::OnAddReview(wxCommandEvent& event)
{
    DlgReview->Show(true);
}

void DialogReviewList::OnEditReview(wxCommandEvent& event)
{
    DlgReview->Show(true);
}
